package cn.sqsoft.springresearch.dal.impl;

import java.util.List;

import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import cn.sqsoft.springresearch.dal.IRoleDAO;
import cn.sqsoft.springresearch.dal.dataobject.RoleDO;

public class IbatisRoleDAO extends SqlMapClientDaoSupport implements IRoleDAO {

	public List selectList() throws DataAccessException {

		return getSqlMapClientTemplate().queryForList("role_select", null);
	}

	public long insert(RoleDO roleDO) throws DataAccessException {
		Long id = (Long) getSqlMapClientTemplate().insert(
				"insertRole", roleDO);
		return id.longValue();
	}	
}
